<html ng-app="text">
  <head>
    <script src="/third_party/static/jquery-2.0.3/jquery.min.js"></script>
    <script src="/third_party/static/angularjs-1.2.0-rc.3/angular.min.js"></script>
    
    <script>
      var GLOBALS = {};
      GLOBALS.placeholder = JSON.parse('{{placeholder|js_string}}');
      GLOBALS.columns = JSON.parse('{{columns|js_string}}');
      GLOBALS.rows = JSON.parse('{{rows|js_string}}');
    </script>
  </head>

  <body onload="onWidgetLoad()">
    <div ng-controller="TextInput">
      <form ng-submit="submitAnswer(answer)">

        <input ng-if="rows == 1" ng-model="$parent.answer"
               placeholder="<[placeholder]>" size="<[cols]>" required autofocus>

        <textarea ng-if="rows != 1" ng-model="$parent.answer"
                  placeholder="<[placeholder]>" required autofocus rows="<[rows]>" cols="<[cols]>">
        </textarea>

        <button type="submit">Submit</button>
      </form>
    </div>

    <script src="/extensions/widgets/interactive/TextInput/static/js/TextInput.js">
    </script>
  </body>
</html>
